const {
	Controller
} = require('uni-cloud-router')
const {
	success,
	exception,
	error,
	typeOf,
	Clock
} = require("lg-utils")
module.exports = class CommonController extends Controller {
	// 移除基金基本信息
	async removeAllFundBase() {
	   try{
	      const res =  this.service.common.removeAllFundBase();
		  if(res){
			  return success(res);
		  }else{
			  return error(res);
		  }
	   }catch(e){
		  return exception(e,this);
	   }
	}
	// 根据基金 code 查询 
	async searchFundBaseInfo() {
	   try{
		   const {data,service} = this.ctx;
		   let params = {};
		   if(typeOf(data,"object")){
			   params = {...data};
		   }else if(typeOf(data,"string,number")){
			   params = data;
		   }else{
			  error("输入参数类型错误！");
		   }
	      const res = await  service.common.searchFundBaseInfo(params);
		  if(res){
			  return success(res)
		  }else{
			  return  error(res);
		  }
	   }catch(e){
		  return exception(e,this);
	   }
	}

}
